﻿@model Dal.Entities.Doc1
@{
    Layout = null;
    ViewBag.Title = "Edit1";
    ViewBag.Nav = 2;
    ViewBag.Menu = 1;
    ViewBag.PassAudit = (Model == null ? false : Model.StatusAudit == 1 ? true : false);
    ViewBag.HasQuestion = Web.Controllers.Common.HasQuestion((int)ViewBag.DocID, 1);
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>病历录入</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Partial("menu")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("edit1", "doc", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                @Html.HiddenFor(i => i.DocID)
                if (ViewBag.Result != null)
                {
                    if (ViewBag.Result == true)
                    {
                <div class="notification confirm">
                    <em>
                        <img src="/assets/img/icons/tick_circle.png" alt="" />操作成功 </em>
                </div>
                    }
                }
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <tbody>
                        <tr class="odd">
                            <td>
                                1
                            </td>
                            <td>
                                <span>是否首次诊断为抑郁症</span> <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.IsFirstTime, "是", new { onclick = "hide('divIsFirstTime')" })
                                是
                                <br />
                                @Html.RadioButtonFor(i => i.IsFirstTime, "否", new { onclick = "show('divIsFirstTime')", id = "rdIsFirstTime" })
                                否
                                <div id="divIsFirstTime" style="padding-left: 30px">
                                    <table>
                                        <tr>
                                            <td>
                                                抑郁病史 :
                                            </td>
                                            <td>
                                                @Html.TextBoxFor(i => i.AdditionHistoryYear, new { style = "width:30px;" }) 年
                                                @Html.TextBoxFor(i => i.AdditionHistoryMonth, new { style = "width:30px;" }) (个)月
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                上次用药 :
                                            </td>
                                            <td>
                                                药物名称: @Html.TextBoxFor(i => i.AdditionMedicineName1)
                                                <br />
                                                用法用量: @Html.TextBoxFor(i => i.AdditionMedicineCount1)
                                                <br />
                                                药物名称: @Html.TextBoxFor(i => i.AdditionMedicineName2)
                                                <br />
                                                用法用量: @Html.TextBoxFor(i => i.AdditionMedicineCount2)
                                                <br />
                                                药物名称: @Html.TextBoxFor(i => i.AdditionMedicineName3)
                                                <br />
                                                用法用量: @Html.TextBoxFor(i => i.AdditionMedicineCount3)
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                此次更新治疗<br />
                                                方案的原因 <span style="color: Red">*</span>
                                            </td>
                                            <td>
                                                @{string reason = Model == null ? "" : Model.AdditionReason ?? "";}
                                                @{string itemreason = "疾病复发";}
                                                <input type="checkbox" name="AdditionReason" id="rdreason1" onclick="toggle('divrdreason1')" value="@itemreason" @(reason.Contains(itemreason) ? "checked = \"checked\"" : "") />
                                                @itemreason
                                                <br />
                                                <div id="divrdreason1" style="padding-left: 30px">
                                                    最近的方案治疗多久后复发：<br />
                                                    @Html.TextBoxFor(i => i.AdditionReason1Year, new { style = "width:30px;" }) 年 @Html.TextBoxFor(i => i.AdditionReason1Month, new { style = "width:30px;" })（个）月
                                                </div>
                                                @{itemreason = "疗效欠佳";}
                                                <input type="checkbox" name="AdditionReason" id="rdreason2"  onclick="toggle('divrdreason2')" value="@itemreason" @(reason.Contains(itemreason) ? "checked = \"checked\"" : "") />
                                                @itemreason
                                                <br />
                                                <div id="divrdreason2" style="padding-left: 30px">
                                                    @{string reason2 = Model == null ? "" : Model.AdditionReason2Detail ?? "";}
                                                    @{string item = "改善力度较弱";}
                                                    <input type="checkbox" name="AdditionReason2Detail" value="@item" @(reason2.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "起效速度太慢"; }
                                                    <input type="checkbox" name="AdditionReason2Detail" value="@item" @(reason2.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                </div>
                                                @{itemreason = "药物不耐受";}
                                                <input type="checkbox" name="AdditionReason" id="rdreason3"  onclick="toggle('divrdreason3')" value="@itemreason" @(reason.Contains(itemreason) ? "checked = \"checked\"" : "") />
                                                @itemreason
                                                <br />
                                                <div id="divrdreason3" style="padding-left: 30px">
                                                    @{string reason3 = Model == null ? "" : Model.AdditionReason3Detail ?? "";}
                                                    @{item = "恶心";}
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "口干"; }
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "嗜睡"; }
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "头晕"; }
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "出汗"; }
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "体重增加"; }
                                                    <input type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <br />
                                                    @{item = "其他"; }
                                                    <input id="ckAdditionReason3DetailOther" onclick="toggle('divckAdditionReason3DetailOther')" type="checkbox" name="AdditionReason3Detail" value="@item" @(reason3.Contains(item) ? "checked = \"checked\"" : "") />
                                                    @item
                                                    <div id="divckAdditionReason3DetailOther" style="padding-left: 30px">
                                                        请填写 @Html.TextBoxFor(i => i.AdditionReason3DetailOther)
                                                    </div>
                                                    <script type="text/javascript">
                                                        associate('ckAdditionReason3DetailOther', 'divckAdditionReason3DetailOther');
                                                    </script>
                                                </div>
                                                @{itemreason = "其他";}
                                                <input type="checkbox" name="AdditionReason" id="rdreason4"  onclick="toggle('divrdreason4')" value="@itemreason" @(reason.Contains(itemreason) ? "checked = \"checked\"" : "") />
                                                @itemreason
                                                <div id="divrdreason4" style="padding-left: 30px">
                                                    请填写 @Html.TextBoxFor(i => i.AdditionReason4Other)
                                                </div>
                                                <script type="text/javascript">
                                                    associate('rdreason1', 'divrdreason1');
                                                    associate('rdreason2', 'divrdreason2');
                                                    associate('rdreason3', 'divrdreason3');
                                                    associate('rdreason4', 'divrdreason4');
                                                </script>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <script type="text/javascript">
                                    associate('rdIsFirstTime', 'divIsFirstTime');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "IsFirstTime", 1, "是否首次诊断为抑郁症"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                2
                            </td>
                            <td>
                                既往应用的其他药物
                            </td>
                            <td>
                                @Html.TextAreaFor(i => i.OtherMedicine, 3, 30, null)
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "OtherMedicine", 1, "既往应用的其他药物"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                3
                            </td>
                            <td>
                                该患者的主要症状 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @{string Symptom = Model == null ? "" : Model.Symptom ?? "";}
                                @{string itemSymptom = "情绪低落";}
                                <input type="checkbox" name="Symptom" value="@itemSymptom" @(Symptom.Contains(itemSymptom) ? "checked = \"checked\"" : "") />
                                @itemSymptom<br />
                                @{itemSymptom = "快感丧失";}
                                <input type="checkbox" name="Symptom" value="@itemSymptom" @(Symptom.Contains(itemSymptom) ? "checked = \"checked\"" : "") />
                                @itemSymptom<br />
                                @{itemSymptom = "兴趣丧失";}
                                <input type="checkbox" name="Symptom" value="@itemSymptom" @(Symptom.Contains(itemSymptom) ? "checked = \"checked\"" : "") />
                                @itemSymptom<br />
                                @{itemSymptom = "精力丧失";}
                                <input type="checkbox" name="Symptom" value="@itemSymptom" @(Symptom.Contains(itemSymptom) ? "checked = \"checked\"" : "") />
                                @itemSymptom<br />
                                @{itemSymptom = "其他";}
                                <input type="checkbox" id = "rdSymptomOther" onclick = "toggle('divrdSymptomOther')" name="Symptom" value="@itemSymptom" @(reason.Contains(itemSymptom) ? "checked = \"checked\"" : "") />
                                @itemSymptom<br />
                                <div id="divrdSymptomOther" style="padding-left: 30px">
                                    请填写： @Html.TextBoxFor(i => i.AdditionSymptom)
                                </div>
                                <script type="text/javascript">
                                    associate('rdSymptomOther', 'divrdSymptomOther');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Symptom", 1, "该患者的主要症状"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                4
                            </td>
                            <td>
                                是否伴有焦虑 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.JiaolvFollow, "是") 是 @Html.RadioButtonFor(i => i.JiaolvFollow, "否")
                                否
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "JiaolvFollow", 1, "是否伴有焦虑"))
                            </td>
                        </tr>
                    </tbody>
                </table>
                <br />
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <tbody>
                        <tr class="odd">
                            <td colspan="4">
                                <span style="font-weight: bold">本次就诊对患者的评估（以下量表三选一）</span>
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                1
                            </td>
                            <td>
                                汉密尔顿抑郁量表（HAMD）评分分值
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.HAMDScore, new { @class = "inputbox", onblur = "caculateHamd()" })
                                <span id="spanHAMDScore" style="color: Red"></span>
                                <script type="text/javascript">
                                    function caculateHamd() {
                                        var desc = "";
                                        if ($.trim($("#HAMDScore").val()) != "") {
                                            var score = parseInt($("#HAMDScore").val());
                                            if (score > 35) {
                                                desc = "可能为严重抑郁";
                                            }
                                            else if (score > 20) {
                                                desc = "可能是轻或中度的抑郁";
                                            }
                                            else if (score > 8) {
                                                desc = "抑郁症状";
                                            }
                                            else if (score <= 8) {
                                                desc = "没有抑郁症状";
                                            }
                                        }
                                        $("#spanHAMDScore").html(desc);
                                    }
                                    caculateHamd();
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "HAMDScore", 1, "汉密尔顿抑郁量表（HAMD）评分分值"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                2
                            </td>
                            <td>
                                蒙哥马利抑郁评定量表(MADRS) 评分分值
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.MADRSScore, new { @class = "inputbox", onblur = "caculateMADRSScore()" })
                                <span id="spanMADRSScore" style="color: Red"></span>
                                <script type="text/javascript">
                                    function caculateMADRSScore() {
                                        var desc = "";
                                        if ($.trim($("#MADRSScore").val()) != "") {
                                            var score = parseInt($("#MADRSScore").val());
                                            if (score > 30) {
                                                desc = "可能为严重抑郁";
                                            }
                                            else if (score > 22) {
                                                desc = "可能是轻或中度的抑郁";
                                            }
                                            else if (score > 12) {
                                                desc = "抑郁症状";
                                            }
                                            else if (score <= 12) {
                                                desc = "没有明显抑郁症状";
                                            }
                                        }
                                        $("#spanMADRSScore").html(desc);
                                    }
                                    caculateMADRSScore();
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "MADRSScore", 1, "蒙哥马利抑郁评定量表(MADRS) 评分分值"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                3
                            </td>
                            <td>
                                其他量表
                            </td>
                            <td>
                                <table border="0">
                                    <tr class="odd">
                                        <td>
                                            量表名称
                                        </td>
                                        <td>
                                            @Html.TextBoxFor(i => i.OtherTableName, new { @class = "inputbox" })
                                        </td>
                                    </tr>
                                    <tr class="even">
                                        <td>
                                            得分
                                        </td>
                                        <td>
                                            @Html.TextBoxFor(i => i.OtherScore, new { @class = "inputbox" })
                                        </td>
                                    </tr>
                                    <tr class="odd">
                                        <td>
                                            结论
                                        </td>
                                        <td>
                                            @Html.TextBoxFor(i => i.OtherConclusion, new { @class = "inputbox" })
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "OtherTableName", 1, "其他量表"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td colspan="4">
                                <span>治疗情况</span>
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                            </td>
                            <td>
                                艾司西酞普兰起始剂量
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.TreatDose, "10 mg", new { onclick = "hide('divrdTreatDose')" })
                                10 mg
                                <br />
                                @Html.RadioButtonFor(i => i.TreatDose, "20 mg", new { onclick = "hide('divrdTreatDose')" })
                                20 mg
                                <br />
                                @Html.RadioButtonFor(i => i.TreatDose, "其他", new { id = "rdTreatDose", onclick = "show('divrdTreatDose')" })
                                其他
                                <div id="divrdTreatDose" style="padding-left: 30px">
                                    请填写： @Html.TextBoxFor(i => i.AdditionTreatDose)
                                </div>
                                <script type="text/javascript">
                                    associate('rdTreatDose', 'divrdTreatDose');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "TreatDose", 1, "艾司西酞普兰起始剂量"))
                            </td>
                        </tr>
                    </tbody>
                </table>
                
                @Html.Partial("savebutton")
            }
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
    @Html.Partial("questionScript")
    @if ((ViewBag.Status == "edit" || ViewBag.Status == "") && ViewBag.PassAudit == false)
    {
        <script type="text/javascript">
            $(document).ready(function () {
                $("#form1").validate({
                    rules: {
                        IsFirstTime: "required",
                        AdditionReason: { required: "#rdIsFirstTime:checked" },
                        Symptom: { required: true },
                        JiaolvFollow: { required: true },
                        AdditionHistoryMonth: { digits: true, range: [1, 11] },
                        AdditionReason1Month: { digits: true, range: [1, 11] },
                        HAMDScore: { digits: true, range: [0, 77] },
                        MADRSScore: { digits: true, range: [0, 60] },
                        OtherScore: { digits: true }
                    },
                    messages: {
                        IsFirstTime: "是否首次诊断为抑郁症为必选项",
                        AdditionReason: { required: "更新治疗方案的原因为必填项" },
                        Symptom: { required: "该患者的主要症状必填项" },
                        JiaolvFollow: { required: "是否伴有焦虑为必填项" },
                        AdditionHistoryMonth: { digits: "请输入数字", range: "范围不正确,应为1-11" },
                        AdditionReason1Month: { digits: "请输入数字", range: "范围不正确,应为1-11" },
                        HAMDScore: { digits: "请输入数字", range: "范围不正确,应为0-77" },
                        MADRSScore: { digits: "请输入数字", range: "范围不正确,应为0-60" },
                        OtherScore: { digits: "请输入数字" }
                    }
                })
            });
        </script>
    }
</body>
</html>
